﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="http://schemas.datacontract.org/2004/07/CC.Yacht" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/CC.Yacht" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:import namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
  <xs:import namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
  <xs:simpleType name="ErrorType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="None" />
      <xs:enumeration value="Unknown" />
      <xs:enumeration value="DatabaseError" />
      <xs:enumeration value="DuplicateUser" />
      <xs:enumeration value="InvalidGame" />
      <xs:enumeration value="InvalidUser" />
      <xs:enumeration value="SessionExpired" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="ErrorType" nillable="true" type="tns:ErrorType" />
  <xs:complexType name="User">
    <xs:sequence>
      <xs:element minOccurs="0" name="UserId" type="xs:long" />
      <xs:element minOccurs="0" name="Username" nillable="true" type="xs:string" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="User" nillable="true" type="tns:User" />
  <xs:simpleType name="Target">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Game" />
      <xs:enumeration value="Lobby" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="Target" nillable="true" type="tns:Target" />
  <xs:simpleType name="ScoreField">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Aces" />
      <xs:enumeration value="Chance" />
      <xs:enumeration value="Fives" />
      <xs:enumeration value="FourOfAKind" />
      <xs:enumeration value="Fours" />
      <xs:enumeration value="FullHouse" />
      <xs:enumeration value="LargeStraight" />
      <xs:enumeration value="Sixes" />
      <xs:enumeration value="SmallStraight" />
      <xs:enumeration value="ThreeOfAKind" />
      <xs:enumeration value="Threes" />
      <xs:enumeration value="Twos" />
      <xs:enumeration value="Yacht" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="ScoreField" nillable="true" type="tns:ScoreField" />
  <xs:complexType name="Dice">
    <xs:sequence>
      <xs:element minOccurs="0" name="Die1" nillable="true" type="tns:Die" />
      <xs:element minOccurs="0" name="Die2" nillable="true" type="tns:Die" />
      <xs:element minOccurs="0" name="Die3" nillable="true" type="tns:Die" />
      <xs:element minOccurs="0" name="Die4" nillable="true" type="tns:Die" />
      <xs:element minOccurs="0" name="Die5" nillable="true" type="tns:Die" />
      <xs:element minOccurs="0" name="RollCount" type="xs:int" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="Dice" nillable="true" type="tns:Dice" />
  <xs:complexType name="Die">
    <xs:sequence>
      <xs:element minOccurs="0" name="Face" type="tns:DieFace" />
      <xs:element minOccurs="0" name="Locked" type="xs:boolean" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="Die" nillable="true" type="tns:Die" />
  <xs:simpleType name="DieFace">
    <xs:restriction base="xs:string">
      <xs:enumeration value="None" />
      <xs:enumeration value="One" />
      <xs:enumeration value="Two" />
      <xs:enumeration value="Three" />
      <xs:enumeration value="Four" />
      <xs:enumeration value="Five" />
      <xs:enumeration value="Six" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="DieFace" nillable="true" type="tns:DieFace" />
  <xs:complexType name="GameState">
    <xs:complexContent mixed="false">
      <xs:extension base="tns:Game">
        <xs:sequence>
          <xs:element minOccurs="0" name="CurrentUser" nillable="true" type="tns:User" />
          <xs:element minOccurs="0" name="Dice" nillable="true" type="tns:Dice" />
          <xs:element xmlns:q1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" minOccurs="0" name="Scorecards" nillable="true" type="q1:ArrayOfKeyValueOflongScorecard6kGEqS3J" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="GameState" nillable="true" type="tns:GameState" />
  <xs:complexType name="Game">
    <xs:sequence>
      <xs:element minOccurs="0" name="GameId" type="ser:guid" />
      <xs:element minOccurs="0" name="IsStarted" type="xs:boolean" />
      <xs:element minOccurs="0" name="Owner" nillable="true" type="tns:User" />
      <xs:element minOccurs="0" name="Players" nillable="true" type="tns:ArrayOfUser" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="Game" nillable="true" type="tns:Game" />
  <xs:complexType name="ArrayOfUser">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="User" nillable="true" type="tns:User" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="ArrayOfUser" nillable="true" type="tns:ArrayOfUser" />
  <xs:complexType name="Scorecard">
    <xs:sequence>
      <xs:element minOccurs="0" name="Aces" type="xs:int" />
      <xs:element minOccurs="0" name="Chance" type="xs:int" />
      <xs:element minOccurs="0" name="Fives" type="xs:int" />
      <xs:element minOccurs="0" name="FourOfAKind" type="xs:int" />
      <xs:element minOccurs="0" name="Fours" type="xs:int" />
      <xs:element minOccurs="0" name="FullHouse" type="xs:int" />
      <xs:element minOccurs="0" name="LargeStraight" type="xs:int" />
      <xs:element minOccurs="0" name="LowerSectionTotal" type="xs:int" />
      <xs:element minOccurs="0" name="Sixes" type="xs:int" />
      <xs:element minOccurs="0" name="SmallStraight" type="xs:int" />
      <xs:element minOccurs="0" name="ThreeOfAKind" type="xs:int" />
      <xs:element minOccurs="0" name="Threes" type="xs:int" />
      <xs:element minOccurs="0" name="Total" type="xs:int" />
      <xs:element minOccurs="0" name="Twos" type="xs:int" />
      <xs:element minOccurs="0" name="UpperSectionBonus" type="xs:int" />
      <xs:element minOccurs="0" name="UpperSectionSubtotal" type="xs:int" />
      <xs:element minOccurs="0" name="UpperSectionTotal" type="xs:int" />
      <xs:element minOccurs="0" name="User" nillable="true" type="tns:User" />
      <xs:element minOccurs="0" name="Yacht" type="xs:int" />
      <xs:element minOccurs="0" name="YachtBonuses" type="xs:int" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="Scorecard" nillable="true" type="tns:Scorecard" />
  <xs:complexType name="ArrayOfGame">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="Game" nillable="true" type="tns:Game" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="ArrayOfGame" nillable="true" type="tns:ArrayOfGame" />
</xs:schema>